package com.zareal.ymcc.feign;

import com.zareal.ymcc.enums.GlobalErrorCode;
import com.zareal.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;

public class InformUserFeignClientFallbackFactory implements FallbackFactory<InformUserFeignClient> {

    @Override
    public InformUserFeignClient create(Throwable throwable) {
        return new InformUserFeignClient() {
            @Override
            public JSONResult list() {
                return JSONResult.error(GlobalErrorCode.USER_FIND_ERROR.getErrorMessage());
            }
        };
    }
}
